#ifndef INCLUDED_TGA_H
#define INCLUDED_TGA_H

#include <lobi/image.h>

struct tga_header_t
{
   uint8_t id_length;
   uint8_t colour_map_type;
   uint8_t image_type;

   // colourmap spec.  5 bytes
   uint16_t     colour_map_first_entry;  // Ignore
   uint16_t     colour_map_length;       // Usually 256
   uint8_t      colour_map_entry_size;   // Usually 24-bit

   // image spec.  10 bytes
   uint16_t     x_origin;  // Ignore
   uint16_t     y_origin;  // Ignore
   uint16_t     width;
   uint16_t     height;
   uint8_t		pixel_depth;       // Usually 24 or 32
   uint8_t		image_descriptor;  // Ignore

   // Added for 'compeletness' :)
   int   components;
   int   bytes;

//   GLenum tgaColourType;
};

int image_sread_tga(const char* data, unsigned len, struct image_t* destination_image, int want_rgba);

#endif /* INCLUDED_TGA_H */
